What needs to change on a 64-bit system is the implementation of Xlib that provides the C language interface to the X11 protocol. While the X11 protocol does not change, there must be changes in Xlib's implementation for 64-bit systems to reflect that fundamental C data types have enlarged, while the X11 protocol remains fixed.
When Xlib was originally conceived, most machines were 32-bit or 16-bit architectures. Because the X11 protocol mandated that certain values must be treated as 32-bit quantities (like pixels, XIDs, window event masks, and 32-bit window property values), Xlib's designers used the long type for such values. C implementations for both 16-bit and 32-bit architectures generally implemented the long type as a 32-bit value. While X was not particularly appropriate for 16-bit computers, the Xlib API was careful to not preclude 16-bit implementations.
The result of this decision to make necessarily 32-bit values in the Xlib API be typedefed or declared of type long is that when the API is implemented on a 64-bit system using the LP64 data type model, these long values are now 64-bit values. At the API level, because 32-bit values fit in 64-bit long types with plenty of room to spare, if you follow all the typing rules of the Xlib API correctly, your X code can recompile and be expected to run properly in a 64-bit environment. But within Xlib's implementation, when data passed through the API is encoded into or decoded from X11 protocol, care must be taken converting between the API and protocol representations of data. Specifically, data declared to be of type long in the API must be resized when moving between the 64-bit API and 32-bit protocol representation of the data. Fortunately, this work is hidden within Xlib's implementation.
Xlib's 64-bit support was completed with the X Consortium's X11R6
release. The 64-bit prototypes for the Xlib API are
the same as the 32-bit prototypes.